#ifndef PLAYSLIDER_H
#define PLAYSLIDER_H

#include <QWidget>
#include <QMouseEvent>

namespace Ui {
class PlaySlider;
}

class PlaySlider : public QWidget
{
    Q_OBJECT

public:
    explicit PlaySlider(QWidget *parent = nullptr);
    ~PlaySlider();

    void setPlayStep(double stepRatio);

private:
    void mousePressEvent(QMouseEvent* event);

    void mouseReleaseEvent(QMouseEvent* event);

    void mouseMoveEvent(QMouseEvent* event);

    void moveSlider();  // 改变outLine的宽, 即修改当前播放长度

signals:
    void setPlayProgress(double playRatio); // 设置播放进度信号

private:
    Ui::PlaySlider *ui;

    int playGrogress = 0;   // 记录当前播放长度
};

#endif // PLAYSLIDER_H
